<?php
direct_url();
		$id=$_GET['id']; //string nha
		
		$db=new db;
		$db->connect();
		$id=mysql_real_escape_string($id);
		//-------------------------- GET TRUYEN ----------------
		$db->query("select * from truyen_tag where alias='".$id."'");
		if($db->num_rows()>0){
			$r1=$db->fetchOne();
			$db->close();
		
		$data['tag']=$r1;
		$cache=new Cache;
		$sql ="select * from truyen_tag_fk where tag_id=".$r1['id']." order by truyen_id desc";
		
		$sql2="select truyen_id from truyen_tag_fk where tag_id=".$r1['id'];
		$url=url_truyen_tag($r1['alias']).'/';
		$og_url=url_truyen_tag($r1['alias']);
		
		$pager = new Pagination($sql,24,4,$url,0,'truyen_2');
		$pager->setDebug(false);
		$data['info'] = $pager->paginate($cache,$sql2);
		$data['nav']	= $pager->renderFullNav();
		}
	
		

	

	
			$data1['og']='<link rel="canonical" href="'.$og_url.'" /><meta name="ROBOTS" content="INDEX,NOFOLLOW"/>';
			if($r1['title']==''){
			$data1[title]=web_title($r1['name']);
			}else{
				$data1[title]=web_title($r1['title']);
			}
			if($r1['seo_description']==''){
			$data1['mota']=$r1['seo_description'];
			}else{
				$data1['mota']=$id;
			}
			if($r1['seo_keyword']==''){
			$data1['keyword']=$r1['seo_keyword'];
			}else{
				$data1['keyword']=$id;
			}
			$data1['keyword']=$id;
			loadview('template/header',$data1);
			loadview("truyen/list_truyen_tag",$data);
			
			
